To machine a workpiece with high precision, a machine tool, such as a machining center, for machining a workpiece by moving a tool attachably and detachably attached to a main spindle and the workpiece fixed and supported on a table relative to each other is configured to, first, measure and find each of the actual length of the tool attached to the main spindle and the actual height position the length in the vertical direction) of the workpiece on the table, and then machine the workpiece on the basis of the length of the tool and the height position (the length in the vertical direction) of the workpiece.
Conventionally, the length of a tool and the height position (the length in the vertical direction) of a workpiece are found by any of the following procedures.
(1) An indicator is attached to a main spindle, and the height position (the length in the vertical direction) of a workpiece is found from the difference between the position of an end of the main spindle at the time when the indicator is in contact with the upper surface of a table, and the position of the end of the main spindle at the time when the indicator is in contact with the upper surface of the workpiece. Meanwhile, tool is attached to the main spindle, and the length of the tool is found by subtracting the height of contact type (or laser type) tool measuring device mounted on the table from the position of the end of the main spindle at the time when the tool is brought into contact with a detection unit (or caused to block a laser beam) of the tool measuring device and is detected by the detection unit of the tool measuring device.
(2) A touch probe attached to a main spindle, and the height position (the length in the vertical direction) of a workpiece is found by subtracting the length of the touch probe from the position of an end of the main spindle at the time when the touch probe is brought into contact with an upper surface of the workpiece and the touch probe detects the workpiece. Meanwhile, a tool is attached to the main spindle, and the length of the tool is found in the same manner as that in the above-described (1).
(3) A touch probe is attached to a main spindle, and the actual length of the touch probe is calculated by subtracting the height of a reference block from the position of an end of the main spindle at the time when the touch probe is brought into contact with an upper surface of the reference block mounted on a table and the touch probe detects the reference block. Then, the height position (the length in the vertical direction) of a workpiece is found by subtracting the actual length of the touch probe from the position of the end of the main spindle at the time when the touch probe is brought into contact with an upper surface of the workpiece and the touch probe detects the workpiece. Meanwhile, a tool is attached to the main spindle, and the length of the tool is found in the same manner as that in the above-described (1).